import request from '@/utils/request'

// 获取员工列表
export const getEmployees = (params) => {
  return request({
    url: '/employees',
    method: 'get',
    params
  })
}

// 获取员工详情
export const getEmployee = (id) => {
  return request({
    url: `/employees/${id}`,
    method: 'get'
  })
}

// 创建员工
export const createEmployee = (data) => {
  return request({
    url: '/employees',
    method: 'post',
    data
  })
}

// 更新员工
export const updateEmployee = (id, data) => {
  return request({
    url: `/employees/${id}`,
    method: 'put',
    data
  })
}

// 删除员工
export const deleteEmployee = (id) => {
  return request({
    url: `/employees/${id}`,
    method: 'delete'
  })
}

// 重置员工密码
export const resetEmployeePassword = (id, password) => {
  return request({
    url: `/employees/${id}/reset-password`,
    method: 'post',
    data: { password }
  })
}

// 启用/禁用员工
export const toggleEmployeeStatus = (id, isActive) => {
  return request({
    url: `/employees/${id}/status`,
    method: 'patch',
    data: { isActive }
  })
}

// 获取部门列表
export const getDepartments = () => {
  return request({
    url: '/employees/departments',
    method: 'get'
  })
}

// 获取职位列表
export const getPositions = () => {
  return request({
    url: '/employees/positions',
    method: 'get'
  })
} 